package cn.fantasy.test.aqs.cyclicBarrier;

import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author ET
 * @description TODO
 * @date 2021/6/21 17:41
 * @Version V1.0
 */
public class Client {
    public static void main(String[] args) {
        CyclicBarrier cyclicBarrier = new CyclicBarrier(3, new TourGuideTask());
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        executorService.execute(new TravelTask(cyclicBarrier, "哈登", 5));
        executorService.execute(new TravelTask(cyclicBarrier, "保罗", 4));
        executorService.execute(new TravelTask(cyclicBarrier, "科比", 1));
    }
}
